const mongoose = require("./db");

const userSchema = mongoose.Schema({
    phone: String, //用户手机号
    password: String, //密码
    username: {
        type: String,
        default: 'TDD'
    },  //用户名
    nickname: {
        type: String,
        default: ""
    },//昵称
    face: {
        type: String,
        default: 'https://www.baidu.com/link?url=AnuJ6ME9OVUH-MMF1fAeM7bleXBgGY_WZ3FXHie77Tq&wd=&eqid=a4166baa00018bef00000002643e7ebf'
    }, //头像
    type: {
        type: String,
        default: "用户"
    },
    userID:{
        type:String,
        default:""
    },
    userSig:{
        type:String,
        default:""
    },
    gender:{
        type: String,
        default: ''
    }
    
    // username: String, //用户名
    // face: String,  //头像
    // title: String, //标题
    // ip: String, //ip地址
    // gender: String, //性别
    // department: String, //所在行业
    // backgound: String, //背景图
})

const userModel = mongoose.model("user", userSchema, "user")

module.exports = { userModel }

/* userModel.create([
    {
        phone: '15630072815', //用户手机号
        password: 'a66666', //密码
    }
]) */